package com.crud.demo1.demos.Service.Impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.crud.demo1.demos.entity.TableUser;
import com.crud.demo1.demos.Mapper.TableUserMapper;
import com.crud.demo1.demos.Service.ITableUserService;
import com.crud.demo1.demos.controller.dto.UserDto;
import org.springframework.stereotype.Service;

/**
 * @author zhangning
 * @since 2024/4/9 16:59
 */
@Service
public class TableUserServiceImpl extends ServiceImpl<TableUserMapper, TableUser> implements ITableUserService {


    @Override
    public IPage<TableUser> getUser(UserDto userDto) {

        return this.getBaseMapper().selectUserPage(new Page<>(userDto.getCurrent(),
                userDto.getPageSize()), userDto);
    }
}